package com.meituan.mapper;

import com.meituan.model.MerchantEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface MerchantMapper {
    @Select(("select * from merchant where merchant_username = #{merchantUsername} and merchant_password=#{merchantPassword}"))
    MerchantEntity findByMerchantUsernameAndMerchantPassword(@Param("merchantUsername") String merchantUsername, @Param("merchantPassword") String merchantPassword);

    @Insert("insert into merchant(merchant_username,merchant_password,merchant_phone) values (#{merchantUsername},#{merchantPassword},#{merchantPhone})")
    Integer save(MerchantEntity merchantEntity);

    @Select("select * from merchant where merchant_username = #{merchantUsername}")
    MerchantEntity findByMerchantUsername(String merchantUsername);
}
